<?php
header("Content-Type:application/json;charset=utf-8");
header("Access-Control-Allow-Origin:*");
$host = "127.0.0.1";
$name = "root";
$pwd = "";
$db = "usermessage";
$port = "3306";
$conn = new mysqli($host, $name, $pwd, $db, $port);
//3.设置连接的字符集
mysqli_query($conn, "set names utf8");